maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=protoc-gen-go
pkgver=1.35.1
pkgrel=0
pkgdesc="Protocol Buffers Go generator"
url="https://github.com/protocolbuffers/protobuf-go"
arch="all"
license="BSD-3-Clause"
depends="protoc"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/protocolbuffers/protobuf-go/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/protobuf-go-$pkgver"
options="net" # download Go modules

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v \
		-ldflags "-X google.golang.org/protobuf/internal/version.PreRelease=" \
		./cmd/protoc-gen-go/
}

check() {
	go test ./...
}

package() {
	install -Dm755 protoc-gen-go -t "$pkgdir"/usr/bin/
}

sha512sums="
562067af648dc2e2477106771f66ae46c03b0f760da364df2307c6709a9490c420d35b41daa181447a40b776156cc2fabc1932df5900a47a515a76c30e8f3078  protoc-gen-go-1.35.1.tar.gz
"
